<div class="library-categories">
<?php foreach($tags as $index=>$list):?>

	<ul>
	<?php foreach($list as $word=>$count):?>
		<li><a href="#"><?php echo $word?></a> (<?php echo $count?>)</li>
	<?php endforeach?>
	</ul>
	
<?php endforeach?>
</div>